Cross-architecture emulation is needed when running native applications on a target platform, or computer, that uses an instruction set architecture (ISA) different from the ISA for which the native applications were initially intended. The developer of a cross-architecture emulation product wants to know that the emulator correctly translates or interprets the native applications. Various schemes exist to verify cross-architecture emulation. However, these schemes cannot easily, if at all, comprehensively test the emulation process.
To improve the emulation process, a binary translation product that runs on the target platform may be used to emulate native instructions running on a native, or legacy, platform. Binary translation automatically translates binary code from the native instruction set to binary code for the target platform without the need for high-level source code. As with any emulation product, a developer of the binary translation product may desire to verify the accuracy of emulation from the native ISA to an ISA operating on a target platform.
One conventional approach to verifying cross-architecture emulation is to send as many native applications as possible through the binary translation product, or emulator, and then verify that the outputs produced by the binary translation product are identical to corresponding outputs produced by the native applications running on the native platform. This conventional approach has several disadvantages. First, the binary translation product designer cannot know whether testing is complete because the native applications are usually compiler-generated and the machine code generated by the binary translation product only includes a subset of the instruction set architecture. Machine instructions that are not in this subset will never be generated in the compiler so that some binary instructions are never tested through the emulation process. Second, running an application through the binary translation product on the target platform and running the same application through the native platform is cumbersome. A separate process may then be needed to verify the results. Third, when an error is detected, pinpointing the exact machine instruction that caused the error may be difficult or impossible. In addition, replication of the emulation error may be impossible to achieve. Fourth, execution of some applications is time- or system-sensitive such that the result of an execution may not be reproducible, which adds to the difficulty ov verifying binary emulation.